﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _22数组
{
    class Program
    {
        static void Main(string[] args)
        {
            //int[] Score = new int[5];
            //Score[0] = 10;
            //Score[4] = 20;
            //Console.WriteLine(Score[0]);
            //Console.WriteLine(Score[4]);

            //练习一
            //int sum = 0;
            //int amx = 0;
            //int[] sex = new int[10];
            //for (int i = 0;i<sex.Length;i++)
            //{
            //    Console.WriteLine("请输入第{0}个人的成绩：", i + 1);
            //    sex[i] = Convert.ToInt32(Console.ReadLine());
            //    sum += sex[i];

            //}
            //Console.Clear();
            //Console.WriteLine("{0}个人的平均成绩为{1}分", sex.Length,sum/sex.Length);
            ////求最大值
            //amx = sex[0];
            //for (int i = 0; i < sex.Length; i++)
            //{
            //    if (sex[i] > amx)
            //    {
            //        amx = sex[i];
            //    }
            //}
            //Console.WriteLine("最高分为：{0}",amx);
            ////输出数组中每一个元素的值
            //for (int i = 0; i < sex.Length; i++)
            //{
            //    Console.WriteLine("第{0}个学生的分数为{1}分", i + 1, sex[i]);
            //}
            //Console.WriteLine();


            //练习二
            //int[] nub = { 3, 5, 6, 37, 98, 65, 34, 54 };
            //int min = nub[0];
            //for (int i = 1; i < nub.Length; i++)
            //{
            //    if (nub[i] > min)
            //    {
            //        min = nub[i];
            //    }
            //}
            //Console.WriteLine("min="+min);


            //练习三
            //int[] sex = {1,21,32,65,2,5,98};
            //int max = 0;
            //for (int i = 0; i < sex.Length; i++)
            //{
            //    max += sex[i];
            //}
            //Console.WriteLine(max);


            //练习四
            //string[] sum = { "梅西", "卡卡", "郑大世" };
            //string str = "";
            //for (int i = 0; i < sum.Length; i++)
            //{
            //    if (i == sum.Length - 1)
            //    {
            //        str = str + sum[i];
            //    }
            //    else
            //    {
            //        str = str + sum[i] + "|";
            //    }
            //}
            //Console.WriteLine(str);


            //练习五
            //int[] mun = { -1, 24, 0, 43, 3, -23, -6, 54, -4 };
            //for (int i = 0; i < mun.Length; i++)
            //{

            //        int len = 0;
            //        len = len + mun[i];
            //        Console.WriteLine(len + 1);

            //}


            //练习六
            //string[] tim = {"梅西", "卡卡", "郑大世"};
            //for (int i = tim.Length - 1; i >= 0; i--)
            //{
            //    Console.WriteLine(tim[i]);
            //}


            //练习七
            string[] nam = { "梅西", "卡卡", "郑大世" };
            string sax;
            for (int i = 0; i < nam.Length / 2; i++)
            {
                sax = nam[i];
                nam[i] = nam[nam.Length - 1 - i];
                nam[nam.Length - 1 - i] = sax;
            }
            for (int i = 0; i < nam.Length; i++)
            {
                Console.WriteLine(nam[i]);
            }






            Console.ReadKey();
        }
    }
}
